<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
		xmlns:ui="http://java.sun.com/jsf/facelets"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:f="http://java.sun.com/jsf/core"
	    xmlns:p="http://primefaces.org/ui"
		xmlns:c="http://java.sun.com/jsp/jstl/core">

	<ui:composition>
	
		<c:if test="${empty disabled}">
			<c:set var="disabled" value="false" />
		</c:if>
	
		<c:set var="converterName" value="#{converterId}" />
		 
		<c:if test="${!rangeSearch}">
	    	<p:outputLabel for="#{field}" value="#{label}" />  
	        <p:inputText id="#{field}" converter ="#{converterName}" value="#{filtersMap[field]}" size="5" disabled="#{disabled}" />
		</c:if>
		<c:if test="${rangeSearch}">
			<p:outputLabel for="fromRangeField_#{field}" value="#{label}" />  
		    <h:panelGrid columns="4">
	   			<c:set var="fromRangeField" value="fromRange-#{field}" />
	   			<h:outputText value="#{messages['commons.from']}" style="padding-right:5px"/>
		        <p:inputText id="fromRangeField_#{field}" value="#{filtersMap[fromRangeField]}" size="5" disabled="#{disabled}">
		        	<f:converter converterId="#{converterName}"/>
		        </p:inputText>
		        
	   			<c:set var="toRangeField" value="toRange-#{field}" />
	   			<h:outputText value="#{messages['commons.to']}" style="padding:5px" />
		        <p:inputText id="toRangeField_#{field}" value="#{filtersMap[toRangeField]}" size="5" disabled="#{disabled}" >
		        	<f:converter converterId="#{converterName}"/>
		        </p:inputText>
		    </h:panelGrid>
		</c:if>
	    
    </ui:composition>

</html>
